package com.mgm.affsettings.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.mgm.dto.AffsettingsDto;
import com.mgm.dto.offer.OfferRoot;
import com.mgm.page.DataGrid;
import com.mgm.pojo.Affsettings;
import com.mgm.result.IMessage;

/**
 * 
 * @ClassName: AffsettingsService 
 * @Description: TODO(...) 
 * @author Andy Zhang
 * @date 2018年6月28日 下午8:52:25 
 *
 */
public interface AffsettingsService {

	// 分页查询
	DataGrid findAll(AffsettingsDto param, Integer pageNum, Integer pageSize);
	
	//修改渠道offer溢价
	IMessage modifyPremium(Integer affId, Integer admentId, Integer advId, Integer premium);
	
	//批量修改渠道offer溢价
	IMessage modifyPremiumBatch(Integer affId, List<Integer> admentIds, Integer premium);
	
	//删除
	IMessage deleteByKeys(Integer affId, Integer admentId, Integer advId);

	//渠道offer设置开关
	IMessage updateEnabled(Integer affId, Integer admentId, Boolean enabled);
	
	//渠道offer设置开关
	IMessage updateEnabledBatch(Integer affId, List<Integer> admentIds, Boolean enabled);
	
	//修改广告对渠道cap
	IMessage modifyCaps(Integer affId, Integer admentId, BigDecimal totalCap, BigDecimal dailyCap);
	
	//获取Affsettings
	Affsettings selectByAffIdAndAdmentId(Integer affId, Integer admentId);
	
	//获取Affsettings
	Affsettings selectByAffIdAndAdmentId(String affid, String admentid);
	
	//调用存储过程（更新offer到 渠道-offer）
	void insertCallAffsetting();
	
	//下发渠道offer
	List<OfferRoot> getAffOffer(Map<String, String> map);
}
